import api from '../api'
import settings from '~/conf/settings'

const state = {
}


const getters = {

}

const actions = {

  printerList({commit, dispatch}, params) {
    return api.get(api.url('printerList'), params)
  },

  machineList({commit, dispatch}) {
    return api.get(api.url('machineList'))
  },

  addMachine({commit, dispatch}, params) {
    return api.post(api.url('addMachine', params.id), params)
  },

  editMachiner({commit, dispatch}, params) {
    return api.put(api.url('editMachiner', params.id), params)
  },

  machineDetail({commit, dispatch}, params) {
    return api.get(api.url('machineDetail', params.id))
  },

  createPrinter({commit, dispatch}, params) {
    return api.post(api.url('createPrinter'), params)
  },

  deletePrinter({commit, dispatch}, params) {
    return api.delete(api.url('deletePrinter', params.id))
  },

  printerDetail({commit, dispatch}, params) {
    return api.get(api.url('printerDetail', params.id))
  },

  editPrinter({commit, dispatch}, params) {
    return api.put(api.url('editPrinter', params.id), params)
  },

  deleteMachine({commit, dispatch}, params) {
    return api.delete(api.url('deleteMachine', params.id))
  },

  authorizeForToken({commit, dispatch}, params) {
    return api.get(api.url('authorizeForToken', params.id))

  }

  // createPosition({commit, dispatch}, params) {
  //   return api.post(api.url('createPosition'), params)
  // },
  //
  // positionDetail({commit, dispatch}, params) {
  //   return api.get(api.url('positionDetail', params.id))
  // },
  //
  // positionEdit({commit, dispatch}, params) {
  //   return api.put(api.url('positionEdit', params.id), params)
  // },
  //
  // positionDelete({commit, dispatch}, params) {
  //   return api.delete(api.url('positionDelete', params.id))
  // }

}

const mutations = {

}

export default {
  state,
  getters,
  actions,
  mutations
}
